package com.jwcao.common.cast.operation.instance;

import com.jwcao.common.scan.object.ScanClass;

/**
 * name: NoArgInstanceOperation description: TODO
 *
 * @author caojingwei date: 2023/3/23 17:11
 */
public class NoArgInstanceOperation implements InstanceOperation {

    private final ScanClass targetClass;

    public NoArgInstanceOperation(ScanClass targetClass) {
        this.targetClass = targetClass;
    }

    @Override
    public Object execute(Object sourceObject) {
        return targetClass.getConstructorAccess().newInstance();
    }
}
